/**
    Copyright 2015 Table Rider
    By: Kristoffer Dahl & Richard Solti
*/

#include "Definitions.h"
long ticks = 0;
int pwm_ticks = 0;
	#include "../../system/CMSIS/Device/ATMEL/sam3xa/include/sam3x8e.h"
  //#include "system_sam3x.h"
  /*
  void SysTick_Handler(void)
  {
      ticks++;
  }
  */
  void PWM_Handler()
  {
////  //Disable PWM Interrupts
////  *(volatile unsigned int*)PWM_IDR1 = 0xff00ff;
  //Read pwm interrupt register(disable interrupt)
  volatile unsigned int check = *(volatile unsigned int*)PWM_ISR1;
    pwm_ticks = !pwm_ticks;
    if(pwm_ticks)
    {
	ticks++;
    dconvertAD();
    //controlDef->update();
	//control->update();
    }
  }
